import React from 'react';
import { Dimensions } from 'react-native';
import ECharts from 'react-native-echarts-pro';
const { width } = Dimensions.get('window');

interface Props {
    setEchartsRef?: any;
    pieOption: any;
    type?: number;
    setEchartsSECGRef?: any;
}
const BezierChart = (props: Props) => {
    const { setEchartsRef, pieOption, type = 0, setEchartsSECGRef } = props;
    return (
        <ECharts
            option={pieOption}
            width={width - 28}
            height={100}
            ref={(ref: any) => {
                if (type == 1) {
                    setEchartsSECGRef(ref);
                } else {
                    setEchartsRef(ref);
                }
            }}
        />
    );
};

export default BezierChart;
